#ifndef _FUNCTIONS_H_
#define _FUNCTIONS_H_

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <float.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <dirent.h>
#include <unistd.h>
#include "variables.h"


//archive.c
extern void print_archives();
extern void initialize_archives();
extern void archives_sort();
extern void calc_individuals_for_selection();

//parameter.c
extern void set_parameters( int number_of_arguments, char **arguments );
extern void set_initial_parameters();
extern void populate_upper_and_lower_limits();
extern void print_arguments_description();

//gnuplot.c
extern void mkdir_for_gnuplot();
extern void finalize_for_gnuplot();
extern void write_plot_for_gnuplot();
extern void write_neighborhood_for_gnuplot();
extern int rmdir_all( const char* dirname );

//individual.c
extern void population_merge();
extern void set_init_center_sigma();
extern double calc_indi_var( const int num, const int d );
extern void initialize_individuals();
extern void population_sort( INDIVIDUAL *individuals, const int num );
extern int individual_comp( const INDIVIDUAL *v0, const INDIVIDUAL *v1 );

// util.c
extern void print_value();
extern void print_target();
extern void update_target();
extern int get_random_integer_value( const int min, const int max );
extern double get_random_double_value( const double min, const double max );
extern void print_sigma();
extern void print_center();
extern void print_num();
extern void print_num_percent();
extern int terminate();
extern void print_best();
extern double gaussrand( const double mu, const double sigma );
extern void print_individuals();
extern double calc_var( const double* array, const int num );

// p_model.c
extern void set_beta();
extern void update_model();
extern void initialize_layers();
extern void destory_cluster();
extern void create_layers();
extern void destory_layers();
extern void set_init_layers();
extern void set_layers();
extern void calc_num_of_population( int *num_individuals );
extern void calc_center();
extern void calc_sigma( const int* num_individuals );

// offspring.c
extern void offspring();

// elite.c
extern void initialize_elite();
extern void elite_replace();

//evaluation.c
extern double evaluate( double *design_variables );
extern double rastrigin( double *x );
extern double rastrigin_1( double *x );
extern double rotated_rastrigin( double *x );
extern double schwefel( double *x );
extern double rosenbrock_s( double *x );
extern double rosenbrock_c( double *x );
extern double ill_scaled_rosenbrock( double *x );
extern double griewank( double *x );
extern double ridge( double *x );
extern double sphere( double *x );
extern double ellipsoid( double *x );
extern double ktablet( double *x );
extern double bohachevsky( double *x );
extern double ackley( double *x );
extern double schaffer( double *x );
extern double f1( double *x );
extern double f2( double *x );
extern double f3( double *x );
extern double f7( double *x );
extern double f8( double *x );


#endif //_FUNCTIONS_H_
